//--------------------------------------------------------------------------------------
// depth2d.fx
//--------------------------------------------------------------------------------------

#include "effects/common.fx"

//--------------------------------------------------------------------------------------

texture gBaseTex;
sampler gBaseSampler = sampler_state
{
    Texture		= <gBaseTex>;
    MinFilter	= POINT;
    MagFilter	= POINT;
    MipFilter	= NONE;
    AddressU	= CLAMP;
    AddressV	= CLAMP;
    AddressW	= CLAMP;
};

//--------------------------------------------------------------------------------------
// Vertex shader
//--------------------------------------------------------------------------------------

struct VS_INPUT
{
    float4 pos	: POSITION;    
    float2 tc	: TEXCOORD0;
};

struct VS_OUTPUT
{
    float4 pos	: POSITION;
    float2 tc	: TEXCOORD0;
};

VS_OUTPUT vs_main( VS_INPUT vi )
{
    VS_OUTPUT vo = (VS_OUTPUT)0;    
	vo.pos = mul( vi.pos, gWVP );
    vo.tc = vi.tc;
    return vo;
}


//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------

struct PS_OUTPUT
{
    float4 c0	: COLOR0;
    float4 c1	: COLOR1;
};

PS_OUTPUT ps_main( VS_OUTPUT vi )
{
	PS_OUTPUT po = (PS_OUTPUT)0;
	po.c0 = tex2D( gBaseSampler, vi.tc );
	po.c1 = float4(1, 0, 0, 1); // rgba
	return po;
}

//--------------------------------------------------------------------------------------
// technique
//--------------------------------------------------------------------------------------

technique T0
{
    pass P0
    {        
        VertexShader = compile vs_2_0 vs_main();
        PixelShader = compile ps_2_0 ps_main();
        
        ZEnable = FALSE;
        ZWriteEnable = FALSE;
        AlphaBlendEnable = FALSE;        
        AlphaTestEnable = FALSE;
        CullMode = NONE;	
    }
}

//--------------------------------------------------------------------------------------